package com.shop.exception;

import com.shop.utils.ResultUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@Slf4j
public class PerssionException {

    @ExceptionHandler(value = UnauthorizedException.class)
    @ResponseBody
    public  ResultUtils perssion(UnauthorizedException exception){
        return ResultUtils.error(501,"权限不足");
    }
}
